﻿using System.Collections.Generic;
using System;

namespace BinaryXmlInspector
{
    public struct Token
    {
        public Token(TokenType type, string value, int start, int end)
        {
            Type = type;
            Value = value;
            StartPosition = start;
            EndPosition = end;
        }
        public TokenType Type;
        public string Value;
        public int StartPosition;
        public int EndPosition;
    }

    public enum TokenType
    {
        ElementBoundary     = Char.MaxValue + 1,        //   <  or  >  or  />
        ElementName         = Char.MaxValue + 2,
        AttributeName       = Char.MaxValue + 3,
        AttributeEquals     = '=',                      //   =
        AttributeBoundary   = '"',                      //   "
        AttributeValue      = Char.MaxValue + 4,
        InnerText           = Char.MaxValue + 5,
        Whitespace          = Char.MaxValue + 6,
        Comment             = Char.MaxValue + 7         // or other entities that begin with <! like CDATA
    }
}